/**
 * @file luogu/4391/main
 * @brief
 * @see
 * @author Ruiming Guo (guoruiming@stu.scu.edu.cn)
 * @copyright 2022
 * @date 2022/6/18 21:48:41
 **/

#include <iostream>
#include <string>
#include <vector>
#define rep(i, a, b) for (int i = (a); i < (int)(b); ++i)
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pi;
const int INF = 0x3f3f3f3f;
const ll LLINF = 0x3f3f3f3f3f3f3f3f;
const int N = 1e6 + 4;
int f[N], n;
string s;
void getFail() {
  f[0] = f[1] = 0;
  for (int i = 1; i < n; ++i) {
    int j = f[i];
    while (j && s[i] != s[j]) j = f[j];
    f[i + 1] = (s[i] == s[j] ? j + 1 : 0);
  }
}
int main() {
  // High rating and good luck!
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n >> s;
  getFail();
  cout << n - f[n] << endl;
  return 0;
}
